import $http from 'axios'
import jsonp from "jsonp"
import $qs from 'qs'
import * as CONFIG from './config'

function $q(param) {
  return $qs.stringify(param)
}
const base_get_url = 'https://test.goktech.cn/';
// const base_get_url = 'https://campus.goktech.cn/';
// const base_get_url = 'https://campus.yunmansk.com/';

/*全部课程列表*/
export function allCourse() {
  return $http.get(CONFIG.URL_CONFIG.ALL_COURSE).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*课程列表（全部课程by城市ID）*/
export function courseByCity(direction, type, cityId) {
  return $http.get(CONFIG.URL_CONFIG.COURSE_BY_CITY + "?direction=" + direction + "&type=" + type + "&city_id=" + cityId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*课程列表（首页课程by城市ID）*/
export function courselistByCategory(direction, type, cityId) {
  return $http.get(CONFIG.URL_CONFIG.COURSELIST_BY_CATEGORY + "?direction=" + direction + "&type=" + type + "&city_id=" + cityId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*获取课程详情*/
export function courseDetail(id) {
  return $http.get(CONFIG.URL_CONFIG.COURSE_DETAIL + '/' + id).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*获取个人资料*/
export function userInfo(type, id, cityId) {
  let param = {
    type: type,
    cluesOrStuId: id,
    cityId: cityId
  }
  return $http.post(CONFIG.URL_CONFIG.ABOUT_ME, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*更新个人资料*/
export function updateInfo(type, id, info, schoolTimetaleList,certificateList) {
  let param = {
    type: type,
    cluesOrStuId: id,
    info: info,
    schoolTimetaleList: schoolTimetaleList,
    certificateList: certificateList
  }
  return $http.post(CONFIG.URL_CONFIG.UPDATE_INFO, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*下单前的个人资料完善*/
export function checkInfoSave(type, id, info) {
  let param = {
    type: type,
    cluesOrStuId: id,
    info: info
  }
  return $http.post(CONFIG.URL_CONFIG.CHECK_INFO_SAVE, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}


/*注册接口*/
export function register(phone, pwd, cityId) {
  let param = {
    phone: phone,
    password: pwd,
    cityId: cityId
  }
  return $http.post(CONFIG.URL_CONFIG.REGISTER, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*登录接口*/
export function login(phone, pwd) {
  let param = {
    phone: phone,
    password: pwd
  }
  return $http.post(CONFIG.URL_CONFIG.LOGIN, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    } else {
      return Promise.resolve(res.data)
    }
  })
}
/*验证码登录接口*/
export function loginByPhone(phone, code) {
  let param = {
    phone: phone,
    verCode: code
  }
  return $http.post(CONFIG.URL_CONFIG.LOGIN_PHONE, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    } else {
      return Promise.resolve(res.data)
    }
  })
}
/*手机号绑定*/
export function bindPhone(phone, code) {
  let param = {
    phone: phone,
    verCode: code
  }
  return $http.post(CONFIG.URL_CONFIG.BINDPHONE, param).then(res => {
    // if (res.data.code == '0') {
    //   return Promise.resolve(res.data.data)
    // }else {
    return Promise.resolve(res.data)
    // }
  })
}
/*短信重置密码*/
export function forgotPwd(phone, code) {
  let param = {
    phone: phone,
    verCode: code
  }
  return $http.post(CONFIG.URL_CONFIG.FORGETPWD, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    } else {
      return Promise.resolve(res.data)
    }
  })
}
/*更新密码*/
export function updatePwd(phone, pwd) {
  let param = {
    phone: phone,
    password: pwd
  }
  return $http.post(CONFIG.URL_CONFIG.UPDATEPWD, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*首页banner*/
export function banner(cityId) {

  return $http.get(CONFIG.URL_CONFIG.BANNER + '?city_id=' + cityId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*首页课程*/
export function homeCourse() {
  return $http.get(CONFIG.URL_CONFIG.HOME_COURSE).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*首页课程（by城市id）*/
export function homeCourseByCity(cityId) {
  return $http.get(CONFIG.URL_CONFIG.HOME_COURSE_BY_CITY + '/' + cityId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*城市列表*/
export function city() {
  return $http.get(CONFIG.URL_CONFIG.CITY).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*更改用户绑定城市*/
export function updateCity(cityId, type, csId) {
  let param = {
    cityId: cityId,
    type: type,
    cluesOrStuId: csId
  }
  return $http.post(CONFIG.URL_CONFIG.UPDATE_CITY, param).then(res => {
    return Promise.resolve(res.data)
  })

}
/*图片上传*/
export function fileUpload(param, headerConfig) {
  return $http.post(CONFIG.URL_CONFIG.FILE_UPLOAD, param, headerConfig).then(res => {
    if (res.data) {
      return Promise.resolve(res.data)
    }
  })
}


/*查询是否有待支付的订单*/
export function orderIsPay(type, id) {
  let param = {
    type: type,
    cluesOrStuId: id
  }
  return $http.post(CONFIG.URL_CONFIG.ORDER_IS_PAY, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}

/*查询订单详情（by 订单号）*/
export function orderDetail(sn) {
  let param = {
    orderSn: sn
  }
  return $http.post(CONFIG.URL_CONFIG.ORDER_DETAIL, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}

/*提交订单*/
export function passOrder(type, id, packId, campusId) {
  let param = {
    type: type,
    cluesOrStuId: id,
    packId: packId,
    campus: campusId
  }
  return $http.post(CONFIG.URL_CONFIG.PASS_ORDER, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}

/*我的订单*/
export function orderByUser(type, id) {
  let param = {
    type: type,
    cluesOrStuId: id,
  }
  return $http.post(CONFIG.URL_CONFIG.ORDER_BY_USER, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*创建支付订单*/
export function createPayOrder(trace, money, user_id) {
  let param = {
    trace: trace,
    money: money,
    user_id: user_id
  }
  return $http.post(CONFIG.URL_CONFIG.CREATE_PAY_ORDER, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*创建微信支付*/
export function createWechatPay(out_trade_no, body, detail, total_fee, user) {
  let param = {
    out_trade_no: out_trade_no,
    body: body,
    detail: detail,
    total_fee: total_fee,
    user: user
  }
  return $http.post(CONFIG.URL_CONFIG.WECHAT_PAY_ORDER, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*查询微信支付状态*/
export function queryQueryWechat(out_trade_no) {
  let param = {
    out_trade_no: out_trade_no,
  }
  return $http.post(CONFIG.URL_CONFIG.QUERY_WECHAT_ORDER, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
// 昵称校验
export function checkNickName(type, id, name) {
  let param = {
    type: type,
    cluesOrStuId: id,
    nickName: name
  }
  return $http.post(CONFIG.URL_CONFIG.CHECK_NICK_NAME, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data)
    }
  })

}
/*创建支付宝支付*/
function toUnicodeFun(data){
  if(data == '' || typeof data == 'undefined') return '请输入汉字';
  var str =''; 
  for(var i=0;i<data.length;i++){
    str+="\\u"+data.charCodeAt(i).toString(16);
  }
  return str;
}
export function createAliPay(out_trade_no, body, subject, total_amount, user,courseId) {
  let url ='';
    url = base_get_url + 'paySuccee?courseId=' + toUnicodeFun(courseId.toString());
    let param = {
      // return_url: 'https://test.goktech.cn/paySuccee',
      return_url: url,
      out_trade_no: out_trade_no,
      body: body,
      subject: subject,
      total_amount: total_amount,
      user: user
    }
    return $http.post(CONFIG.URL_CONFIG.ALI_PAY_ORDER, param).then(res => {
      if (res.data.code === '0') {
        return Promise.resolve(res.data.data)
      }
    })
}
// 创建一网通支付
export function createYiwtPay(out_trade_no, body, subject, total_amount, user,courseId) {
    let url ='';
    url = base_get_url + 'api/yiWT/paySucceed/' + courseId.toString();
    let param = {
      return_url: url,
      out_trade_no: out_trade_no,
      body: body,
      subject: subject,
      total_amount: total_amount,
      user: user
    }
  return $http.post(CONFIG.URL_CONFIG.YIWT_PAY_ORDER, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
// 创建聚合支付
export function createPolymPay(out_trade_no, total_amount, payWay) {
    let param = {
      out_trade_no: out_trade_no,
      total_amount: total_amount,
      payWay:payWay
    }
  return $http.post(CONFIG.URL_CONFIG.POLYM_PAY_ORDER, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
/*查询聚合微信支付状态*/
export function queryPolyqWechat(out_trade_no) {
  let param = {
    out_trade_no: out_trade_no,
  }
  return $http.post(CONFIG.URL_CONFIG.POLYQ_PAY_ORDER, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
// 关闭订单
export function orderClose(orderId) {
  return $http.get(CONFIG.URL_CONFIG.ORDER_CLOSE + '/' + orderId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}
// 删除订单
export function orderDelete(orderId) {
  return $http.get(CONFIG.URL_CONFIG.ORDER_DELETE + '/' + orderId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}
// 查看分期详情
export function instalOrderById(orderId) {
  return $http.get(CONFIG.URL_CONFIG.INSTAL_ORDER_BY_ID + '/' + orderId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}
// 意见反馈
export function feedbackAdd(name, msgText, type, id, phone) {
  let param = {
    name: name,
    message: msgText,
    type: type,
    cluesOrStuId: id,
    phone: phone
  }
  return $http.post(CONFIG.URL_CONFIG.FEED_BACK, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data)
    }
  })
}
// 是否可以意见反馈
export function canFeedBack(type, id) {
  let param = {
    type: type,
    cluesOrStuId: id
  }
  return $http.post(CONFIG.URL_CONFIG.CAN_FEED_BACK, param).then(res => {
    if (res.data.code === '0') {
      return Promise.resolve(res.data)
    }
  })
}

/*查询个人信息是否完善*/
export function checkCluesInfo(type, id, priceType) {
  let param = {
    type: type,
    cluesOrStuId: id,
    priceType: priceType
  }
  return $http.post(CONFIG.URL_CONFIG.CHECK_CLUES_INFO, param).then(res => {
    return Promise.resolve(res.data)
  })
}
/*通过手机号获取type和id*/
export function infoByTel(phone) {
  let param = {
    phone: phone
  }
  return $http.post(CONFIG.URL_CONFIG.INFO_BY_TEL, param).then(res => {
    return Promise.resolve(res.data)
  })
}
// 分期支付
export function findByHireSn(orderId) {
  return $http.get(CONFIG.URL_CONFIG.FIND_BY_HIRE_Sn + '/' + orderId).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}

/*检测课程是否已经报名*/
export function checkSign(type, id, courseId) {
  let param = {
    type: type,
    cluesOrStuId: id,
    packId: courseId
  }
  return $http.post(CONFIG.URL_CONFIG.CHECK_SIGN, param).then(res => {
    return Promise.resolve(res.data)
  })
}
/*传交易记录到后台*/
export function postTradeRecord(orderSn, platform) {
  let param = {
    sn: orderSn,
    platform: platform,
  }
  return $http.post(CONFIG.URL_CONFIG.POST_TRADE_RECORD, param).then(res => {
    return Promise.resolve(res.data)
  })
}
/*付款后查询是否支付成功*/
export function orderPaySuccess(orderSn) {
  let param = {
    sn: orderSn
  }
  return $http.post(CONFIG.URL_CONFIG.ORDER_PAY_SUCCESS, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}
// 付款成功后返回成功页面
export function backSuccess(packId){
  // console.log(CONFIG.URL_CONFIG.PAY_SUCESS + '/' + packId)
  return $http.post(CONFIG.URL_CONFIG.PAY_SUCESS + '/' + packId).then(res =>{
    if(res.data.code=='0')
    {
      return Promise.resolve(res.data.data)
    }
  })
}

// 0套餐报名请求
export function signUpFree(type, cluesOrStuId, packId, campusId) {
  let param = {
    type: type,
    cluesOrStuId: cluesOrStuId,
    packId: packId,
    campus: campusId
  }
  return $http.post(CONFIG.URL_CONFIG.SIGN_UP_FREE, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}
//获取订单倒计时服务器时间
export function getMinusTime() {
  return $http.get(CONFIG.URL_CONFIG.GET_MINUS_TIME).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}
export function getCustomer(id) {
  let param = {
    cityid: id
  }
  return $http.post(CONFIG.URL_CONFIG.GET_CUSTOMER, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}

export function statisticsSave(cityid,cityName,userId,userName) {
  let param = {
    cityId: cityid,
    cityName: cityName,
    userId: userId,
    userName: userName,
  }
  return $http.post(CONFIG.URL_CONFIG.STATISTICS_SAVE, param).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data)
    }
  })
}

// 邮箱验证有没有被注册过
export function checkEmail(email, id) {
  let param = {
    email: email,
    id: id
  }
  return $http.post(CONFIG.URL_CONFIG.CHECK_EMAIL, param).then(res => {
    if (res.status == '200') {
      return Promise.resolve(res.data)
    }
  })
}

// 邮箱发送验证 MAIL_SEND
export function emailSend(email) {
  let param = {
    email: email
  }
  return $http.post(CONFIG.URL_CONFIG.MAIL_SEND, param).then(res => {
    if (res.status == '200') {
      return Promise.resolve(res.data)
    }
  })
}
//头像base64上传
export function uploadBase64(param, headerConfig) {
  return $http.post(CONFIG.URL_CONFIG.UPLOAD_BASE, param, headerConfig).then(res => {
    if (res.data) {
      return Promise.resolve(res.data)
    }
  })
}

//报名切换城市，获取相同套餐id
export function getCourseIdByCity(packId, cityId) {
  return $http.get(CONFIG.URL_CONFIG.GET_PACK_ID + "?pack_id=" + packId + "&city_id=" + cityId).then(res => {
   
      return Promise.resolve(res.data.data)
    
  })
}
// 查找我的课程
export function findMyPack(id) {
  let param = {
    stu_id: id
  }
  let config = {
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  }
  // return $http.post(CONFIG.URL_CONFIG.FIND_MY_PACK+'?stu_id='+id, config).then(res => {
  return $http.post(CONFIG.URL_CONFIG.FIND_MY_PACK,$q(param),config).then(res => {  
    if (res.data.code === '0') {
      return Promise.resolve(res.data)
    }
  })
}
//班级风采列表
export function bannerClassFindAll(title,currPage,pageSize) {
  let param = {
    title: title,
    currPage: currPage,
    pageSize: pageSize
  }
  
  return $http.post(CONFIG.URL_CONFIG.BANNER_CLASS_FIND_ALL,param).then(res => {  
    if (res.data.code === '0') {
      return Promise.resolve(res.data)
    }
  })
}
//班级风采详情
export function bannerClassFindOne(id) {
  return $http.get(CONFIG.URL_CONFIG.BANNER_CLASS_FIND_ONE + id).then(res => {
   
      return Promise.resolve(res.data.data)
    
  })
}

//开班计划web
export function classPlan(id) {
  return $http.get(CONFIG.URL_CONFIG.CLASS_PLAN_FIND_STU_ID + id).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}

//线索开班计划web
export function cluesClassPlan(id) {
  return $http.get(CONFIG.URL_CONFIG.FIND_BY_CLUES + id).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}

// 首页师资力量
export function getTeachList() {
  var url = '//www.goktech.cn/gw-ht/f/team/teamList'
  return new Promise((resolve,reject)=>{
    jsonp(url,{},(err,data)=>{
        if(!err){
            resolve(data)
        }else{
            reject(err)
        }
    })
  })
}

// 查找我的班
export function findMyClass(id) {
  let param = {
    stu_id: id
  }
  let config = {
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  }
  return $http.post(CONFIG.URL_CONFIG.FIND_MY_CLASS,$q(param),config).then(res => {  
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
//试听课开班列表
export function classPlanNoLogin() {
  return $http.get(CONFIG.URL_CONFIG.CLASS_PLAN_NOLOGIN).then(res => {
    return Promise.resolve(res.data.data)
  })
}
// 开班计划报名
export function addToClassPlan(hcId, classPlanId) {
  let param = {
    hcId,
    classPlanId
  }
  let config = {
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  }
  return $http.post(CONFIG.URL_CONFIG.ADD_TO_CLASS_PLAN,$q(param), config).then(res => {  
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    } else {
      return Promise.reject(res.data)
    }
  })
}
// 开班计划就业课报名
export function addToGraduClassPlan(hcId, classPlanId) {
  let param = {
    hcId,
    classPlanId
  }
  let config = {
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  }
  return $http.post(CONFIG.URL_CONFIG.ADD_TO_GRADU_PLAN,$q(param), config).then(res => {  
    if (res.data.code === '0') {
      return Promise.resolve(res.data.data)
    } else {
      return Promise.reject(res.data)
    }
  })
}
// 查看考核成绩
export function getExamResult(cluesOrStuId, formalclassid){
  return $http.get(CONFIG.URL_CONFIG.EXAM_RESULTS + "/" + cluesOrStuId + "/" + formalclassid).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}
// 提交空余时间反馈
export function submitCalendars(remark, calendars){
  let param = {
    remark,
    calendars
  }
  return $http.post(CONFIG.URL_CONFIG.CALENDARS_CALENDARS, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data)
    }
  })
}

// 学员心路历程
export function getProcess(cluesOrStuId){
  return $http.get(CONFIG.URL_CONFIG.PROCESS_DATA + cluesOrStuId ).then(res => {
    if (res.data.code == '0') {
      return Promise.resolve(res.data.data)
    }
  })
}

//二维码
export function getWXACodeUnlimit(page,id) {
  let param = {
    scene: id,
    page: page
  }
  let config = {
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    responseType:'arraybuffer'
  }
  return $http.post(CONFIG.URL_CONFIG.GET_WX_ACODE_UNLIMIT,$q(param), config).then(res => {  
    // console.log(res)
    if (res.status == 200) {
      return Promise.resolve(res.data)
    }else{
      return Promise.reject(false)
    }
  })
}

// 查看系统消息和私信
export function findGmessageList(currPage, pageSize,telephone,status,gmessageType,from){
  let param = {
    currPage:currPage,
    pageSize:pageSize,
    telephone:telephone,
    status:status,
    gmessageType:gmessageType,
    from:1
  }
  return $http.post(CONFIG.URL_CONFIG.FIND_GMESSAGE_LIST, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data)
    }
  })
}

// 标记消息未读为已读
export function markreadList(telephone, gmessageType,from){
  let param = {
    telephone:telephone,
    gmessageType:gmessageType,
    from:1
  }
  return $http.post(CONFIG.URL_CONFIG.ALL_READ, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data)
    }
  })
}

// 标记未读为已读
export function markonereadList(id,status){
  let param = {
    id:id,
    status:status
  }
  return $http.post(CONFIG.URL_CONFIG.UP_GDATA, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data.data)
    }
  })
}


// 清除近三个月的消息
export function removeThreemonthdataList(telephone,gmessageType,from){
  let param = {
    telephone:telephone,
    gmessageType:gmessageType,
    from:1
  }
  return $http.post(CONFIG.URL_CONFIG.REMOVE_NEARLY_THREEMONTH_AGO, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data)
    }
  })
}


//素材文件上传成功，返回数据上传
export function saveMaterialList(stuId,url,key,size,name,type){
  let param = {
    stuId:stuId,
    url:url,
    key:key,
    size:size,
    name:name,
    type:type
  }
  return $http.post(CONFIG.URL_CONFIG.SAVE_MATERIAL, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data)
    }
  })
}

//获取素材列表
export function getMaterialList(stuId){
  let param = {
    stuId:stuId
  }
  return $http.post(CONFIG.URL_CONFIG.GET_MATERIAL_LIST, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data)
    }
  })
}

//删除素材
export function deleteAliyunfileList(id,key){
  let param = {
    id:id,
    key:key
  }
  return $http.post(CONFIG.URL_CONFIG.DELETE_ALIYUN_FILE, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data.data)
    }
  })
}

//删除素材完执行
export function deleteMaterialList(id){
  let param = {
    id:id
  }
  return $http.post(CONFIG.URL_CONFIG.DELETE_MATERIAL_FILE, param).then(res => {
    if (res.data.code == 0) { 
      return Promise.resolve(res.data)
    }
  })
}

